package thread;

/*
 * @author zzr
 * @date: 2025/03/28  20:01
 * @description:
 */

class MyThread4 extends Thread {
    @Override
    public void run() {
        while(true) {
            System.out.println("hello thread");
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }
    }
}
public class ThreadDemo11 {
    public static void main(String[] args) throws InterruptedException {
        Thread t = new MyThread4();
        t.start();
//        t.run();

        while(true) {
            System.out.println("hello main");
            Thread.sleep(1000);
        }
    }
}
